Skip to content

Remove getNonNullableType application in checkIdentifier #60523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bgenia
Copy link

@bgenia bgenia commented Nov 17, 2024

Fixes #60514

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Nov 17, 2024
@Andarist
Copy link
Contributor

Out of pure curiosity - do you know why this doesn't regress the tests introduced by #50092 ? :p

@jakebailey
Copy link
Member

That PR's test didn't seem to enable strict mode...

@bgenia
Copy link
Author

bgenia commented Nov 18, 2024

Enabling strict mode in that test causes undefined to appear in the baselines, but everything still seems correct. I also tried applying these changes directly to that PR to ensure that other PRs didn't affect it, and the result is the same, both with and without strict null checks. I guess this wasn't needed? At least for that test.

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 30, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started 👀 Results
user test this ✅ Started 👀 Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60523/merge:

Something interesting changed - please have a look.

Details

puppeteer

test/tsconfig.json

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,370 62,370 ~ ~ ~ p=1.000 n=6
Types 50,386 50,386 ~ ~ ~ p=1.000 n=6
Memory used 196,006k (± 0.73%) 196,571k (± 0.08%) ~ 196,291k 196,740k p=0.689 n=6
Parse Time 1.61s (± 1.14%) 1.59s (± 1.56%) ~ 1.54s 1.61s p=0.140 n=6
Bind Time 0.88s (± 1.95%) 0.88s (± 1.38%) ~ 0.87s 0.90s p=0.796 n=6
Check Time 11.75s (± 0.53%) 11.75s (± 0.50%) ~ 11.67s 11.83s p=0.936 n=6
Emit Time 3.28s (± 1.89%) 3.33s (± 2.53%) ~ 3.25s 3.49s p=0.377 n=6
Total Time 17.53s (± 0.46%) 17.54s (± 0.42%) ~ 17.46s 17.65s p=0.872 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 58 +2 (+ 3.57%) ~ ~ p=0.001 n=6
Symbols 948,753 948,753 ~ ~ ~ p=1.000 n=6
Types 410,846 410,846 ~ ~ ~ p=1.000 n=6
Memory used 1,225,193k (± 0.00%) 1,225,264k (± 0.01%) ~ 1,225,161k 1,225,375k p=0.173 n=6
Parse Time 7.98s (± 0.53%) 7.92s (± 0.43%) -0.06s (- 0.71%) 7.86s 7.95s p=0.029 n=6
Bind Time 2.29s (± 0.93%) 2.29s (± 0.36%) ~ 2.28s 2.30s p=0.463 n=6
Check Time 38.05s (± 0.39%) 37.92s (± 0.42%) ~ 37.69s 38.12s p=0.335 n=6
Emit Time 17.85s (± 0.40%) 17.88s (± 0.42%) ~ 17.79s 17.97s p=0.471 n=6
Total Time 66.17s (± 0.23%) 66.01s (± 0.23%) ~ 65.72s 66.14s p=0.126 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,509,183 2,509,183 ~ ~ ~ p=1.000 n=6
Types 892,716 892,716 ~ ~ ~ p=1.000 n=6
Memory used 2,804,455k (± 0.00%) 2,804,457k (± 0.00%) ~ 2,804,327k 2,804,564k p=0.936 n=6
Parse Time 10.51s (± 0.47%) 10.51s (± 0.20%) ~ 10.48s 10.53s p=0.872 n=6
Bind Time 2.76s (± 0.58%) 2.76s (± 0.62%) ~ 2.74s 2.78s p=0.742 n=6
Check Time 100.89s (± 0.27%) 102.89s (± 2.10%) +2.00s (+ 1.98%) 100.96s 106.41s p=0.031 n=6
Emit Time 0.37s (± 3.14%) 0.37s (± 2.04%) ~ 0.36s 0.38s p=0.396 n=6
Total Time 114.53s (± 0.25%) 116.53s (± 1.86%) +1.99s (+ 1.74%) 114.58s 120.08s p=0.045 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,081 1,227,081 ~ ~ ~ p=1.000 n=6
Types 267,474 267,474 ~ ~ ~ p=1.000 n=6
Memory used 2,852,957k (±13.20%) 2,730,884k (±14.68%) ~ 2,363,900k 3,097,656k p=1.000 n=6
Parse Time 6.65s (± 0.80%) 6.63s (± 1.77%) ~ 6.48s 6.77s p=0.873 n=6
Bind Time 2.17s (± 1.32%) 2.15s (± 1.25%) ~ 2.12s 2.18s p=0.374 n=6
Check Time 42.77s (± 0.44%) 42.90s (± 0.76%) ~ 42.65s 43.51s p=0.575 n=6
Emit Time 3.44s (± 2.11%) 3.49s (± 6.00%) ~ 3.30s 3.82s p=0.873 n=6
Total Time 55.05s (± 0.54%) 55.20s (± 0.69%) ~ 54.80s 55.89s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,081 1,227,081 ~ ~ ~ p=1.000 n=6
Types 267,474 267,474 ~ ~ ~ p=1.000 n=6
Memory used 3,040,576k (± 9.78%) 2,918,960k (±12.85%) ~ 2,433,610k 3,162,506k p=0.378 n=6
Parse Time 6.92s (± 1.21%) 6.86s (± 1.88%) ~ 6.71s 7.04s p=0.298 n=6
Bind Time 2.17s (± 2.41%) 2.20s (± 1.88%) ~ 2.14s 2.24s p=0.377 n=6
Check Time 42.93s (± 0.41%) 42.84s (± 0.33%) ~ 42.60s 42.96s p=0.689 n=6
Emit Time 3.54s (± 1.42%) 3.52s (± 1.88%) ~ 3.43s 3.59s p=0.688 n=6
Total Time 55.57s (± 0.29%) 55.43s (± 0.47%) ~ 55.07s 55.69s p=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,548 262,548 ~ ~ ~ p=1.000 n=6
Types 107,156 107,156 ~ ~ ~ p=1.000 n=6
Memory used 441,874k (± 0.01%) 441,874k (± 0.01%) ~ 441,783k 441,949k p=0.936 n=6
Parse Time 3.53s (± 1.01%) 3.54s (± 1.57%) ~ 3.47s 3.61s p=1.000 n=6
Bind Time 1.32s (± 1.07%) 1.31s (± 0.79%) ~ 1.30s 1.33s p=0.410 n=6
Check Time 18.87s (± 0.17%) 18.85s (± 0.21%) ~ 18.81s 18.91s p=0.376 n=6
Emit Time 1.53s (± 1.53%) 1.54s (± 1.16%) ~ 1.52s 1.56s p=0.452 n=6
Total Time 25.25s (± 0.17%) 25.24s (± 0.17%) ~ 25.16s 25.29s p=0.574 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,367 225,367 ~ ~ ~ p=1.000 n=6
Types 94,290 94,290 ~ ~ ~ p=1.000 n=6
Memory used 371,185k (± 0.03%) 371,189k (± 0.05%) ~ 371,056k 371,552k p=0.810 n=6
Parse Time 3.60s (± 0.74%) 3.59s (± 0.84%) ~ 3.56s 3.63s p=0.871 n=6
Bind Time 1.97s (± 0.95%) 1.96s (± 1.42%) ~ 1.93s 2.01s p=0.196 n=6
Check Time 20.33s (± 0.28%) 20.28s (± 0.27%) ~ 20.19s 20.36s p=0.257 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.91s (± 0.31%) 25.83s (± 0.27%) ~ 25.71s 25.91s p=0.172 n=6
vscode - node (v18.15.0, x64)
Errors 33 33 ~ ~ ~ p=1.000 n=6
Symbols 3,499,319 3,499,319 ~ ~ ~ p=1.000 n=6
Types 1,177,227 1,177,227 ~ ~ ~ p=1.000 n=6
Memory used 3,549,840k (± 0.00%) 3,549,778k (± 0.01%) ~ 3,549,488k 3,550,289k p=0.471 n=6
Parse Time 14.94s (± 0.41%) 14.95s (± 0.49%) ~ 14.87s 15.06s p=0.872 n=6
Bind Time 4.86s (± 0.18%) 4.85s (± 0.45%) ~ 4.81s 4.87s p=0.284 n=6
Check Time 95.25s (± 2.90%) 95.08s (± 3.45%) ~ 92.94s 101.03s p=0.471 n=6
Emit Time 30.34s (± 5.58%) 31.38s (± 8.14%) ~ 29.21s 35.64s p=0.689 n=6
Total Time 145.38s (± 2.28%) 146.26s (± 3.68%) ~ 141.93s 153.70s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 318,019 318,019 ~ ~ ~ p=1.000 n=6
Types 137,705 137,705 ~ ~ ~ p=1.000 n=6
Memory used 472,209k (± 0.01%) 472,203k (± 0.04%) ~ 472,007k 472,511k p=0.810 n=6
Parse Time 4.37s (± 0.51%) 4.36s (± 1.00%) ~ 4.31s 4.42s p=0.627 n=6
Bind Time 1.78s (± 1.89%) 1.77s (± 0.85%) ~ 1.75s 1.79s p=0.935 n=6
Check Time 20.72s (± 0.53%) 20.70s (± 0.51%) ~ 20.55s 20.85s p=0.810 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.87s (± 0.28%) 26.83s (± 0.52%) ~ 26.67s 27.04s p=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 665,978 665,978 ~ ~ ~ p=1.000 n=6
Types 199,345 199,345 ~ ~ ~ p=1.000 n=6
Memory used 570,365k (± 0.01%) 570,173k (± 0.04%) ~ 569,951k 570,390k p=0.093 n=6
Parse Time 5.29s (± 0.50%) 5.29s (± 0.44%) ~ 5.25s 5.31s p=1.000 n=6
Bind Time 1.64s (± 0.94%) 1.66s (± 1.64%) ~ 1.63s 1.70s p=0.167 n=6
Check Time 24.58s (± 0.24%) 24.53s (± 0.28%) ~ 24.46s 24.64s p=0.261 n=6
Emit Time 0.00s 0.01s (±154.76%) ~ 0.00s 0.02s p=0.174 n=6
Total Time 31.52s (± 0.17%) 31.50s (± 0.27%) ~ 31.42s 31.64s p=0.688 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60523/merge:

Something interesting changed - please have a look.

Details

ether/etherpad-lite

src/tsconfig.json

facebook/lexical

5 of 16 projects failed to build with the old tsc and were ignored

tsconfig.json

langchain-ai/langchainjs

87 of 95 projects failed to build with the old tsc and were ignored

langchain-core/tsconfig.json

langchain-core/tsconfig.cjs.json

@Andarist
Copy link
Contributor

Andarist commented Jul 1, 2025

This feels like something that shouldn't be required in strict mode without reporting an error or the need to add an assertion or smth: TS playground. This puppeteer break looks like an improvement to me

All other breaks reported above look basically the same to me. They assign to an unannotated variable from within a callback and then access that auto-typed variable with a non-null assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Weird behaviour with an "evolving any" and a non-null assertion operator
4 participants